package zy2;

/**
 * 平行四边形
 */
public class Rhomboid extends Graph{
    private int sd;
    private int xd;
    private int gao;

    public Rhomboid(int sd, int xd, int gao) {
        this.setSd(sd);
        this.setXd(xd);
        this.setGao(gao);
    }

    public Rhomboid() {
    }

    public int getSd() {
        return sd;
    }

    public void setSd(int sd) {
        this.sd = sd;
    }

    public int getXd() {
        return xd;
    }

    public void setXd(int xd) {
        this.xd = xd;
    }

    public int getGao() {
        return gao;
    }

    public void setGao(int gao) {
        this.gao = gao;
    }

    @Override
    public void perimeter() {
        double zc = 2*(getSd() + getXd());
        System.out.println("平行四边形的周长:"+zc);
    }

    @Override
    public void area() {
        double mj = getGao() *(getSd() + getXd())/2;
        System.out.println("平行四边形的面积:"+mj);
    }
}
